package logic.med.scene
{
	import br.com.stimuli.loading.BulkProgressEvent;
	
	import common.AFactory.AScene;
	import common.core.Config;
	import common.core.GSprite;
	import common.manager.GUI;
	import common.manager.Resource;
	import common.world.World;
	
	import flash.events.Event;
	
	import logic.def.Def;
	import logic.med.ui.Login;

	public class PreScene extends AScene
	{
		static public const NAME : String = "PreScene";
		
		private var m_login : Login;
		
		public function PreScene()
		{
			Resource.add(Def.Facade,Def.FacadeURL);
			Resource.add("Avatar",Config.getURL("avatar"));
			
			Resource.start(null,loadComplete);
		}
		
		private function loadProgress(evt:BulkProgressEvent) : void
		{
			
		}
		
		private function loadComplete(evt:BulkProgressEvent) : void
		{
			if(evt.itemsLoaded == evt.itemsTotal)
			{
				Resource.stop(null,loadComplete,loadProgress);
				initUI();
			}
		}
		
		private function initUI() : void
		{
			m_login = new Login;
			
			GUI.open(Login.NAME);
		}
	}
}